#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os

from Atm.conf import config
def logger(account_id, msg):
    '''
    记录日志信息
    :param account: 用户id
    :param msg:     日志信息
    :return:
    '''
    log_path = config.LOG
    log_file = os.path.join(log_path['path'], log_path['name'])
    if log_path['engine'] == 'file':
        with open(log_file, 'a', encoding='utf-8') as f:
            f.write(log_path['format'] % (account_id, msg) + '\n')
            return True